#ifndef __BGOD_OBJECT_H__
#define __BGOD_OBJECT_H__

#include "bgod.h"
#include "point.h"
#include "vector.h"
#include "texture.h"
//#include "list.h"

#define OBJECT_COMMON_INIT() texture(Texture::INVALID_TEXTURE), color(0.8,0,0.6), rotation(Point(0,1,0)) , scale(Point(1,1,1))

//using BGOD::Event;
using BGOD::Object;
using BGOD::Point;
using BGOD::Vector;
using BGOD::Texture;

class Object
{
    public:

        Object() : OBJECT_COMMON_INIT() { }
		Object(Point c) : OBJECT_COMMON_INIT() { setCenter(c); }
        virtual ~Object() {};

        virtual void draw() = 0;

        virtual void sendEventsPreCollision() = 0;
        virtual void sendEventsPosCollision() = 0;
        //virtual void sendEvents() = 0;
        //virtual void getCollisions() = 0;

        inline Point getCenter() const { return center; }
        inline Vector getRotation() const { return rotation; }
        inline Vector getScale() const { return scale; }
        inline float getAngle() const { return angle; }

        virtual void transformationMatrix();
        virtual void applyAttributes();

        inline void setCenter(Point c) { center = c; }
        inline void setRotation(Vector r) { rotation = r; }
        inline void setScale(Vector s) { scale = s; }
        void setAngle(float a);
		inline void setMaterial(int materialId);
		inline void setColor(Point newColor) { color = newColor; }

        inline Point getColor() { return color; }

        inline int getTexture() { return texture; }
        inline void setTexture(char tex) { texture = tex; }

        void setUpTexture();
        void tearDownTexture();

    private:
		void applyRotation();
		void applyScale();
		void applyTranslation();

    protected:
		char texture;
        Point center,color;
        float angle;
        Vector rotation, scale;
};

#endif /* __BGOD_OBJECT_H__ */

